package com.java.dp.proxy;

/**
 * @Author lizhilong
 * @create 2019/12/3 13:43
 * @desc 代理对象
 */
public class XiechengProxy implements BuyTicket {

    private BuyTicket buyTicket;

    public XiechengProxy(BuyTicket buyTicket){
        this.buyTicket = buyTicket;
    }

    @Override
    public void buyTickt() {
        beforeBuy();
        buyTicket.buyTickt();
        afterBuy();
    }

    private void  beforeBuy(){
        System.out.println("购买火车票之前需要在携程app预约");
    }

    private  void  afterBuy(){
        System.out.println("购买成功要支付手续费");
    }
}
